class ManageFriendRenderer extends eui.ItemRenderer {
    private manageGroup:eui.Group;
    private cell1Imag:eui.Image;
    private smallCircleImage1:eui.Image;
    private friendName:eui.Label;
    private deleteImage:eui.Image;

    public constructor(){
        super();
        this.manageGroup=new eui.Group();
        this.cell1Imag=new eui.Image;
        this.smallCircleImage1=new eui.Image();
        this.friendName=new eui.Label();
        this.deleteImage=new eui.Image();

        this.manageGroup.addChild(this.cell1Imag);
        this.manageGroup.addChild(this.smallCircleImage1);
        this.manageGroup.addChild(this.friendName);
        this.manageGroup.addChild(this.deleteImage);
        this.addChild(this.manageGroup);
        this.deleteImage.addEventListener(egret.TouchEvent.TOUCH_TAP,this.Onclick,this);
    }

    protected dataChanged():void{
        //显示数据中的 label 值
        this.smallCircleImage1.source="resource/assets/FriendsWin/小圆.png";
        this.smallCircleImage1.x=42;
        this.smallCircleImage1.y=36;
        this.friendName.text=this.data.name;
        this.friendName.textColor=0x0F2540;
        this.friendName.fontFamily="Alibaba PuHuiTi";
        this.friendName.size=26;
        this.friendName.x=128;
        this.friendName.y=56;
        this.deleteImage.source="resource/assets/FriendsWin/ManageFriend/删除.png";
        this.deleteImage.x=605;
        this.deleteImage.y=50;
        this.cell1Imag.source="resource/assets/FriendsWin/ManageFriend/单元格.png";
        this.cell1Imag.x=12;
        this.cell1Imag.y=12;
        
    }

    
    private Onclick():void{
        var noticRectangleImage=new eui.Image();
        var yesDeleteImage=new eui.Image();
        var noImage=new eui.Image();
        noticRectangleImage.source="resource/assets/FriendsWin/ManageFriend/提示框底.png";
        noticRectangleImage.x=136;
       noticRectangleImage.y=526;
        yesDeleteImage.source="resource/assets/FriendsWin/ManageFriend/对删掉他.png";
        yesDeleteImage.x=211;
        yesDeleteImage.y=714;
        noImage.source="resource/assets/FriendsWin/ManageFriend/不了.png";
        noImage.x=463;
        noImage.y=715;
        this.data.skin.addChild(noticRectangleImage);
        this.data.skin.addChild(yesDeleteImage);
        this.data.skin.addChild(noImage);
        noImage.addEventListener(egret.TouchEvent.TOUCH_TAP, (e) => {
              noticRectangleImage.visible=false;
              yesDeleteImage.visible=false;
              noImage.visible=false;
        }, this);
        yesDeleteImage.addEventListener(egret.TouchEvent.TOUCH_TAP, (e) => {
            noticRectangleImage.visible=false;
            yesDeleteImage.visible=false;
            noImage.visible=false;
            this.data.list.removeItemAt(this.data.item);
        }, this);
    }

}